package com.uchiha.nova.core.model.entity;

import cn.hutool.core.date.DatePattern;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.uchiha.nova.core.tool.support.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;


/**
 * 租户账户 实体类
 *
 * @author magic
 */
@Data
@TableName("nova_tenant")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "Tenant对象")
public class TenantEntity extends BaseEntity implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 租户id
	 */
    @Schema(description = "租户id")
    @TableField("tenant")
	private String tenant;
	/**
	 * 租户名称
	 */
    @Schema(description = "租户名称")
    @TableField("tenant_name")
	private String tenantName;
	/**
	 * 域名地址
	 */
    @Schema(description = "域名地址")
    @TableField("domain")
	private String domain;
	/**
	 * 系统背景
	 */
    @Schema(description = "系统背景")
    @TableField("background_url")
	private String backgroundUrl;
	/**
	 * 联系人
	 */
    @Schema(description = "联系人")
    @TableField("linkman")
	private String linkman;
	/**
	 * 联系电话
	 */
    @Schema(description = "联系电话")
    @TableField("contact_number")
	private String contactNumber;
	/**
	 * 联系地址
	 */
    @Schema(description = "联系地址")
    @TableField("address")
	private String address;
	/**
	 * 失效日期
	 */
    @Schema(description = "失效日期")
    @TableField("expire_time")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN, timezone = "GMT+8")
	@JsonDeserialize(using = LocalDateTimeDeserializer.class)
	@JsonSerialize(using = LocalDateTimeSerializer.class)
	private LocalDateTime expireTime;
	/**
	 * 数据源
	 */
    @Schema(description = "数据源")
    @TableField("datasource_id")
	private String datasourceId;
	/**
	 * 授权码
	 */
    @Schema(description = "授权码")
    @TableField("license_key")
	private String licenseKey;

}
